<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Article\Article;
use common\models\Article\ArticleCategory;

/* @var $this yii\web\View */
/* @var $model common\models\Article\Article */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="article-form box box-primary">
    <?= $this->render('@app/views/layouts/_tab.php') ?>
    <?php $form = ActiveForm::begin(); ?>
    <div class="box-body table-responsive">

        <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

        <?= $form->field($model, 'pid')->dropDownList(ArticleCategory::getListForOptions()) ?>

        <?= $form->field($model, 'status')->dropDownList(Article::getStatusOptions(), ['default' => 1]) ?>

        <?= $form->field($model, 'content')->widget(\kriss\wangEditor\WangEditorWidget::className(), [
            'clientJs' => "{name}.customConfig.uploadImgServer = '/upload/wang-upload',{name}.customConfig.uploadFileName='file'",
        ]); ?>
    </div>
    <div class="box-footer">
        <?= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-success btn-flat']) ?>
    </div>
    <?php ActiveForm::end(); ?>
</div>
